//
//  SocietyDetailViewController.m
//  Product_NEWS
//
//  Created by dllo on 15/12/28.
//  Copyright © 2015年 FCH. All rights reserved.
//

#import "SocietyDetailViewController.h"
#import "SocietyDetailView.h"
@interface SocietyDetailViewController ()

@end

@implementation SocietyDetailViewController

- (void)viewDidLoad {
    SocietyDetailView *headLineDV = [[SocietyDetailView alloc]initWithFrame:[[UIScreen mainScreen]bounds] SocietyModel:self.model];
    
    [self.view addSubview:headLineDV];
    self.navigationItem.title = @"新闻详情";
    //    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"detail.png"] forBarMetrics:UIBarMetricsDefault];
    headLineDV.contentSize = CGSizeMake(headLineDV.frame.size.width, 400 +headLineDV.contentLabel.frame.size.height);
    [headLineDV release];
    
    
    UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [leftButton setImage:[UIImage imageNamed:@"iconfont-fanhui_meitu_1"] forState:UIControlStateNormal];
    leftButton.frame = CGRectMake(0, 0, 30*SCREEN_WIDTH, 30 * SCREEN_HEIGHT);
    [leftButton addTarget:self action:@selector(leftButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc]initWithCustomView:leftButton]autorelease];
    
    UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [rightButton setImage:[UIImage imageNamed:@"iconfont-sangedian_meitu_2"] forState:UIControlStateNormal];
    rightButton.frame = CGRectMake(0, 0, 30 * SCREEN_WIDTH, 30 * SCREEN_HEIGHT);
    [rightButton addTarget:self action:@selector(rightButtonAction:) forControlEvents:UIControlEventTouchUpInside];
    
    self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]initWithCustomView:rightButton]autorelease];
    
    
    
    
}



-(void)leftButtonAction:(UIButton *)btn{
    
    [self.navigationController popToRootViewControllerAnimated:YES];
    self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:212 / 255.0 green:25 / 255.0 blue:37 / 255.0 alpha:1];
    
}

//收藏......!!!!!!!!
-(void)rightButtonAction:(UIButton *)btn
{
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
